#include <iostream>
#include <string>
#include <memory>

#include "error.hpp"
#include "pollServer.hpp"

void Usage(std::string arg)
{
    std::cout << "\n Usage: \n\t" << arg << " port"
              << "\n\t" << std::endl;
}

std::string transmition(const std::string &request)
{
    return request;
}

// ./main 8080
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
    }

    std::unique_ptr<Server::pollServer> us(new Server::pollServer(transmition, atoi(argv[1])));
    us->InitServer();
    us->Start();
    return 0;
}